home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / texts / amoszine / arts / po_how_do.asc < prev    next >
Text File  |  1992-09-02  |  8KB  |  164 lines

  1.       @2
  2.                       H O W   D O   T H E Y   D O   T H A T ?
  3.       @6
  4.                                       by
  5.       @3
  6.                                    Paul Overy.
  7.       @4
  8.       
  9.       So what's this new section all about?
  10.       @1
  11.       Basically I'm going to attempt to explain techniques used in full 
  12.       priced games, giving you a deeper knowledge into games programming. 
  13.       I decided to write this column as there many techniques spread over 
  14.       a wide area of games, & like all good idea's kept secret giving game 
  15.       companies the upper hand.  But all is not lost.  Just by looking 
  16.       carefully the way its code operates, you can tell with a curtain 
  17.       accuracy how it was written. 
  18.       Even if a resulting method does not use the same techniques as one 
  19.       you were trying to emulate, who cares as long as its fast & can 
  20.       compete with standards today.  You may just have come up with a 
  21.       better routine.
  22.  
  23.       While I've got your attention, if you would like the basis of a game
  24.       explained then write to:-
  25.       @3
  26.                                  Paul Overy
  27.                                  27 Barton Road
  28.                                  Maidstone
  29.                                  Kent
  30.                                  ME15 7BU
  31.                                  England
  32.       @1
  33.       Hopefully your answer will be in the next issue of the Amoszine.
  34.  
  35.       @5
  36.       Time to take apart same games.
  37.       @4
  38.       I'll be looking at Project X, Zool, OverDrive & Micro Machines.
  39.       
  40.       @2
  41.       Project X.
  42.       @1This is one high class game, using the very best in Amiga 
  43.       techniques.
  44.  
  45.       Your ship & side shots are 16 colour sprites animated at full 50fps.
  46.  
  47.       i.e.  One Ship = 32*32 pixel sprite.
  48.             Two Side shots 16*64(maybe larger) pixel sprites.
  49.       @1NOTE:The two side shots are a good choice for the use of sprites, as
  50.       it can be of any length of a lowres screen.
  51.       
  52.       All other ships weapons included missiles are at 25fps, & are 
  53.       animated as bobs.
  54.       
  55.       Other attacking crafts, which are bobs animated at 25fps including 
  56.       power ups.  Looking at the game I would say the only objects at full 
  57.       frame rate would be the fast moving background stars (pixels) & the 
  58.       3 sprites defined above.  The fast moving stars flicker as would real 
  59.       ones, but I think this is because they are drawn last & so sometimes 
  60.       miss syncronisation with the screen.
  61.       
  62.       The Large moving background screen is scrolled at 25fps, I 
  63.       measured this buy marking off 320 pixels and timing a staring & end 
  64.       point.  The result from this was about 11-12 seconds, which indicates 
  65.       a steady frame rate of 25fps.
  66.       i.e.  320/25 = 12.8 (which is close to my time by hand timer)
  67.       
  68.       The background scroll appears to be 32cols, and uses maximum 
  69.       overscan.  The game employees screen offsetting on the y-axis to 
  70.       give a up & down scroll motion on the ships vertical movements.
  71.       They probably also use the same kind of scroll method as my 
  72.       Swap-Scrolly (fully documented in AZ2), although as the screen 
  73.       scrolls at a constant rate in the same direction this is very much 
  74.       easier to do.  The screen is probably moved in 32 different sections 
  75.       in the background over 2 frames, & is displayed every other frame 
  76.       buy which time all the sections have been moved.  This above 
  77.       method is if they updated the borders every 16 pixels, meaning they
  78.       only need to move a block of 9 pixels in height & screen width every 
  79.       frame.  If borders were updated every 32pixels then an even higher 
  80.       number of cutting sections could be used,64 in total for even less 
  81.       drain on CPU time.
  82.       
  83.       @2
  84.       Zool.
  85.       @1
  86.       Just a quicky on this one, but never the less is still & very good 
  87.       technique to used in almost any game.
  88.       
  89.       The well used doppel-ganger effect, allowing two Zool characters on 
  90.       screen when you hit a power up.
  91.       Two objects can be displayed at no extra cost, as each is displayed
  92.       on a different frame.  So no extra time is taken up, although the 
  93.       characters do flash as they can't both be on the screen at the same 
  94.       time.  But this flashing looks as if its meant to be there giving a 
  95.       invisible type of effect.  A Good technique to use when you have no
  96.       more spare sprites.
  97.  
  98.       @2
  99.       Micro Machines
  100.       @1
  101.       This has to be one of the easiest games to write, as it uses a simple 
  102.       scroll algo.  How cant people say this 16 col scroll, 4 col car game is
  103.       better then the 32 col scroll, 16 col car game Overdrive!
  104.       
  105.       It uses a 16 pixel boundary update & the screen in moved in one go 
  106.       on every boundary update.  In-between  this the screen is offset in 
  107.       the correct direction to give a scroll effect.  Very lazy.
  108.       Because of the nature of the scroll there is hardly any time left to
  109.       update any bobs, the only extra object apart from sprites in the game
  110.       is a black blob used for a shadow effect for when the cars jump.
  111.       As very title update time is left only the sprites can now be used.  
  112.       They needed to used all eight of the 16*16 pixels sprites, resulting in
  113.       only being able to use 4 colours sprites. (yuk)
  114.       So 4 sprites are used as cars & the left over's for the dust marks 
  115.       when a car turns a tight corner.
  116.       
  117.       Wow this games so hard to write, I've given you example code.
  118.       (see Micro_Machines.Amos but you will need the Turbo extension)
  119.       
  120.       @2
  121.       OverDrive
  122.       @1
  123.       This is more like it, a car game that has actually been programmed 
  124.       with full use of the Amiga's hardware.
  125.       
  126.       I think their method of scrolling is very close to mine, again see 
  127.       Swap-Scroll in Amoszine 2.
  128.       Your car is a 16 colour sprite, 32x32 pixels with the spare sprites 
  129.       being used as smoke/dust rings.
  130.       They somehow managed to display two cars on screen as bobs, this 
  131.       must have been really critical as updating these bobs must of socked 
  132.       up ever spare bit of game time, otherwise they would of gone for 4 
  133.       cars on screen.
  134.       
  135.       You may have noticed that when turning in a full circle the scroll 
  136.       engine moves the screen in a square shape, so the car has to be 
  137.       moved from the centre point to correct this lack in scroll.
  138.       Which in my opinion looks rather nice, backing up my assumptions
  139.       of their scroll method.  As my own scroll method can't move off at
  140.       a angle if the border is not lying on a 16 pixel boundary.
  141.       
  142.       Why this strange square movement scroll? 
  143.       Well Team-17 are using an advanced scroll method, which can't 
  144.       scroll off at an angle while the border boundary lie outside the 16 or 
  145.  
  146.       32 pixel boundary.
  147.       So this square movement enforces this, so & all that needs to be 
  148.       done is to re-centre the car once the true scroll is underway.
  149.  
  150.  
  151.       @3
  152.       That's it, no more ideas for this issue.
  153.       @5
  154.       Don't forget to write to me if you have any questions on games, I deal
  155.       with anything from adding two numbers to ray-casting.
  156.       @1
  157.       I say..."Doom can be done on the Amiga"
  158.       You will just have to have it in black and white & turn the monitor on
  159.       its side so all the screen writes are byte aligned, also using the
  160.       hardware vertical line scan to help convert your data.
  161.       Either that or re-solder your chip memory for non-sequential writes,
  162.       meaning one write will be treated as parallel, placing information of
  163.       each bit plane on number of chips in one go.
  164.